import { defineStore } from "pinia";

const useAppStore = defineStore("app", {
  state: () => ({
    menuCollapse: false,
    device: "desktop",
    serverMenu: [],
    hideMenu: false,
  }),

  getters: {
    appDevice(state) {
      return state.device;
    },
  },

  actions: {
    updateSettings(partial) {
      // @ts-ignore-next-line
      this.$patch(partial);
    },

    toggleMenu(value) {
      this.hideMenu = value;
    },
  },
});

export default useAppStore;
